/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

Ext.ns('dusin.component');

var now = new Date();
var thisYear = now.getFullYear();

var years = new Array();
for (var i = 0; i < 10; i++) {
    years[i] = new Array();
    years[i][0] = thisYear+1 - i;
}

var yearsStore = new Ext.data.SimpleStore({
    fields: ['year'],
    data: years
});

dusin.component.YearCombo = Ext.extend(Ext.form.ComboBox, {
    store: yearsStore,
    displayField: 'year',
    valueField: 'year',
    editable: false,
    mode: 'local',
    forceSelection: true,
    triggerAction: 'all',
    width: 80,
    selectOnFocus: true,
    style: {marginLeft: '0px'}
});

Ext.reg('yearcombo', dusin.component.YearCombo);